#pragma once
#include <math/vector.h>
#include <graphics/batcher.h>

namespace gecko { class Entity; }

// scrolling starfield effect for conveying a sense of movement
class MoveEffect
{
public:
	// constructor
	MoveEffect();

	// initialise the effect
	void Initialise(float size, gecko::IEffect* effect);

	// draw the effect
	void Render(gecko::IRenderer* render);

	// attach to an entity
	void Attach(gecko::Entity * entity);

private:
	void BuildQuad(gecko::Vertex* verts, gecko::Vector3f& pos, gecko::Colour& colour);

	static const int MAX_POINTS = 5000;

	// the entity the effect is attached to
	gecko::Entity* m_entity;

	// the size of the area
	float m_size;

	// position data
	gecko::Vector3f m_positions[MAX_POINTS];

	// render data
	gecko::Vector3f m_renderPositions[MAX_POINTS];

	// geometry
	gecko::DynamicGeometryInstance m_geometry;
};